package com.monicaca.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.monicaca.bean.User;
import com.monicaca.service.UserService;

@Controller
public class HelloWorldController {
	
	@Autowired
	UserService userService;
	
	@RequestMapping("helloworld")
	public String helloWorldView(
			Model model){
		
		User user = userService.findByUserId(1);
		
		model.addAttribute("user", user);
		
		return "index";
	}
}
